package com.example.chapter05;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;

public class DrawableShapeActivity extends AppCompatActivity implements View.OnClickListener {

    private View v_content;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_drawable_shape);
        v_content = findViewById(R.id.V_content);
        findViewById(R.id.btn_rect).setOnClickListener(this);
        findViewById(R.id.btn_oval).setOnClickListener(this);
        //v_content的背景设置为圆角矩形

    }

    @Override
    public void onClick(View view) {
//        if (view.getId() == R.id.btn_oval){
//            v_content.setBackgroundResource(R.drawable.shape_oval_rose);
//
//        }
//        else {
//            v_content.setBackgroundResource(R.drawable.shape_rect_gold);
//        }
    }
}